import request from '@/utils/request'
import {client} from '@/utils/tools'
//文章分类
export function getCategoryList(data) {
    let {type} = data
    let url = type ? 'help/category' : 'article/category'
    delete data.type
    return request.get(url)
}

//文章列表
export function getArticleList(data) {
    let {type} = data
    let url = type ? 'help/lists' : 'article/lists'
    delete data.type
    return request.get(url, {
        params: data
    })
}

//文章列表
export function getArticleDetail(data) {
    return request.get('article/detail', {
        params: data
    })
}

// 产品详情
export function getHelpDetail(data) {
    return request.get('help/detail', {
        params: { id: data.id }
    })
}
export function getHelpInfo(data) {
    return request.get('help/info', {
        params: { id: data.id }
    })
}

// 
export function getArticleOpen(data) {
    let url = 'help/opne'
    delete data.type
    return request.get(url, {
        params: { id: data.id }
    })
}


export function createCustomer(data){
	return request.post('help/createCustomer',data)
}

export function createCustomer2(data){
	return request.post('help/createCustomer2',data)
}

export function queryQrCode(data) {
    return request.get('help/queryQrCode', {
        params: { id: data.id }
    })
}

// 错误码文章列表
export function getHelpArticleList(data) {
    return request.get('help_article/lists', {
        params: data
    })
}

// 文章详情
export function getHelpArticleDetail(data) {
    return request.get('help_article/detail', {
        params: data
    })
}

// 错误码文章列表
export function getErrorCodeList(data) {
    return request.get('error_code/lists', {
        params: data
    })
}